<?php
/*
 * Created on 03.01.2006
 *
 */
 
class xbt_permHandler 
{

    function startElement (& $sender, $attrs, $line)
    {
        if (!isset($attrs['var']))
        {
            die ("Attribute var is missing in xbt:perm tag in line $line\n");
        }
        if (!isset($attrs['id']))
        {
            die ("Attribute id is missing in xbt:perm tag in line $line\n");
        }
        if (!isset($attrs['perm']))
        {
            die ("Attribute perm is missing in xbt:perm tag in line $line\n");
        }
        $sender->appendCode('$__usr = &$env->getAttribute("__usr"); $actionform->set('.$attrs['var'].', $__usr->checkPermission('.$attrs['id'].', '.$attrs['perm'].'));'."\n");
    }
    
    function endElement (& $sender)
    {
    }

}

?>
